﻿using System;
using System.Collections.Generic;

namespace WJ.Infrastructure.Cache
{

    public interface ICacheStrategy
    {

        T GetOne<T>(string key);

        void SetOne<T>(string key, T value, TimeSpan timeOut);

        void SetOne<T>(string key, T value);

        void SetRangToList(string key, List<string> value);

        void RemoveOne(string key);

        void SetList<T>(string key, List<T> value, Func<T, object> getItemKey);

        void RemoveOneByList<T>(string key, T value, Func<T, object> getItemKey);

        void SetOneByList<T>(string key, T value, Func<T, object> getItemKey);

        List<T> GetList<T>(string key);

        T GetOneByList<T>(string key, Guid id);

        void PushToList(string listId, string value);

        string PopFromList(string listId);
    }

}
